﻿@using Mondial2014.Models.Competition
@model List<Mondial2014.Controllers.StatsController.GameResultStatsViewModel>

@{
    ViewBag.Title = "סטטיסטיקה";
}

<h2>סטטיסטיקת שלב הבתים</h2>

@Html.ActionLink("חזרה לבחירת סוג סטטיסטיקה", "Index")

<div class="form-horizontal">

    @for (var groupNumber = 0; groupNumber < 8; groupNumber++)
    {
        <h4>בית @(groupNumber + 1)</h4>

        <table class="table">
            <tr>
                <th>
                    משחק מספר
                </th>
                <th>
                    תאריך
                </th>
                <th>
                    קבוצה 1
                </th>
                <th>
                    קבוצה 2
                </th>
                <th>
                    תוצאה
                </th>
                <th>
                    ניחשו 1 (%)
                </th>
                <th>
                    ניחשו 2 (%)
                </th>
                <th>
                    ניחשו X (%)
                </th>
            </tr>

            @for (var gameNumber = (6 * groupNumber); gameNumber < (6 * groupNumber + 6); gameNumber++)
            {
                <tr>
                    <td>
                        @Html.DisplayFor(modelItem => Model[gameNumber].GameNumber)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => Model[gameNumber].Date)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => Model[gameNumber].Team1Name)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => Model[gameNumber].Team2Name)
                    </td>
                    <td>
                        @{ var result = Model[gameNumber].Result; }
                        @if (result == FixtureResult.Team1)
                        { @Html.Label("1") }
                        @if (result == FixtureResult.Team2)
                        { @Html.Label("2") }
                        @if (result == FixtureResult.Tie)
                        { @Html.Label("X") }
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => Model[gameNumber].Guessed1)
                        &nbsp;&nbsp;
                        (@Html.DisplayFor(modelItem => Model[gameNumber].Percent1)%)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => Model[gameNumber].Guessed2)
                        &nbsp;&nbsp;
                        (@Html.DisplayFor(modelItem => Model[gameNumber].Percent2)%)
                    </td>
                    <td>
                        @Html.DisplayFor(modelItem => Model[gameNumber].GuessedX)
                        &nbsp;&nbsp;
                        (@Html.DisplayFor(modelItem => Model[gameNumber].PercentX)%)
                    </td>
                </tr>
            }

        </table>
    }

</div>

@Html.ActionLink("חזרה לבחירת סוג סטטיסטיקה", "Index")